package com.example.aijiancece.database.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.aijiancece.database.entity.HistoryEntity;

import java.util.List;

@Dao
public interface HistoryDao {
    @Query("SELECT * FROM history ORDER BY timestamp DESC")
    List<HistoryEntity> getAll();

    @Insert
    void insert(HistoryEntity history);

    @Query("DELETE FROM history WHERE id = :id")
    void delete(String id);

    @Query("DELETE FROM history")
    void deleteAll();
} 